package cn.ustb.serviceImpl;

import cn.ustb.dao.ExemptionApplyDao;
import cn.ustb.entity.ExemptionApply;
import cn.ustb.service.ExemptionApplyService;
import cn.ustb.util.MyBatisUtil;
import org.apache.ibatis.session.SqlSession;

/**
 * @author yuyan
 */
public class ExemptionApplyServiceImpl implements ExemptionApplyService {
    @Override
    public void insert(ExemptionApply exemptionApply) {
        SqlSession sqlSession=null;
        try{
            sqlSession= MyBatisUtil.getInstance();
            ExemptionApplyDao exemptionApplyDao=sqlSession.getMapper(ExemptionApplyDao.class);
            exemptionApplyDao.insert(exemptionApply);
            sqlSession.commit();
        }catch(Exception e){
            e.printStackTrace();
        }finally {
            if(sqlSession!=null){
                sqlSession.close();
            }
        }
    }
}
